let user=require('../../db/useradmin')
let userfamily=require('../../db/familylist')




module.exports=async (req,resp)=>{
 
    let obj=req.body;
    let newobj={}

    for (let key in obj) {
        if(!(obj[key]=="全部"||obj[key]=="")){
            newobj[key]=obj[key]
        }
    }
    let sourceData=await user.find(newobj);

//uid为患者id
    let uid=sourceData[0].uid;
   // 根据患者id去查询对于的家属
   let userfamilydata=await userfamily.find({pid:uid})
   console.log("家属信息",userfamilydata);
    resp.json({
        status:"success",
        statuscode:200,
        data:userfamilydata
    })
}